#ifndef OBJECT_HPP
#define OBJECT_HPP
#include "SDL.h"
#include "sdl_resources.hpp"
#include "curse_sheet.hpp"
#include "names.hpp"
#include <string>
using namespace std;

enum class ObjType{
    UNKNOWN = 0,
    CREATURE,
    GROUND,
    WALL,
    EQUIPMENT,
    ARMOR,
    WEAPON
};

class Object{
public:
    Object(ObjType type);
    /* @brief 设置物体坐标*/
    void SetPosition(int x, int y);
    /* @brief 以偏移量移动物体*/
    void Move(int offset_x, int offset_y);
    /* @brief 获得当前坐标*/
    SDL_Point GetPosition() const;
    /* @brief 获得上一回合的坐标*/
    SDL_Point GetOldPos() const;
    void SetColor(SDL_Color color);
    SDL_Color GetColor();
    /* @brief 设置物体的名字*/
    void SetName(Names name);
    string GetName() const;
    ObjType GetType() const;
    void GoBack();

    /* 绘制物体*/
    virtual void Draw();

    /* 更新物体逻辑*/
    virtual void Update();

    bool IsCollidable() const;
protected:
    SDL_Color _color;
    SDL_Point _position;
    SDL_Point _oldpos;
    Names _name;
    ObjType _type;
    bool _iscolliable;
};

ostream& operator<<(ostream& o, Object& obj);

#endif
